package com.ruoyi.web.controller.zbg;

import com.ruoyi.system.domain.CostRequest;
import com.ruoyi.system.domain.vo.zbg.AnnualCostDataVo;
import com.ruoyi.system.domain.vo.zbg.MonthlyRepairDataVo;
import com.ruoyi.system.domain.vo.zbg.RepairDateVo;
import com.ruoyi.system.mapper.MonthlyRepairDataMapper;
import com.ruoyi.system.service.AnnualCostDataService;
import com.ruoyi.system.service.CostDataService;
import com.ruoyi.system.service.MonthlyRepairDataService;
import com.ruoyi.web.tool.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("成本")
@RestController
@RequestMapping("/zbg")
public class ZbgCostController {
    @Autowired
    private AnnualCostDataService annualCostDataService;
    @Autowired
    private CostDataService costDataService;
    @Autowired
    private MonthlyRepairDataService monthlyRepairDataService;
    @ApiOperation("获取成本维修费首页数据")
    @PostMapping("/getCostMaintenanceData")
    public Result<List<AnnualCostDataVo>> getCostMaintenanceData(@RequestBody CostRequest  costRequest) {
      List<AnnualCostDataVo> annualCostDataVos =  annualCostDataService.getCostMaintenanceData(costRequest);
      return Result.success(annualCostDataVos);
    }
    @ApiOperation("获取成本维修费详情数据")
    @PostMapping("/getCostMaintenanceDetailData")
    public Result<List<RepairDateVo>> getCostMaintenanceDetailData(@RequestBody CostRequest costRequest) {
        List<RepairDateVo> costRequests = monthlyRepairDataService.getCostMaintenanceDetailData(costRequest);
        return Result.success(costRequests);
    }



}
